{include file="admin/top.php" subject='suppliers'}
{include file="suppliers/top.php" subject='suppliers'}
<div id="content">

    <div id="boxquery">
    <form method="get">
         <input type="hidden" name="m" value="inventory" />
        <input type="hidden" name="s" value="suppliers.php" />
        <input type="submit" value="查询" class="fr" />
        <li>关键字:&nbsp; <input id="keywords" name="keywords" type="text" size="30" onclick="select()" value="{$smarty.get.keywords}"
        onkeyup="context_menu_suppliers(this, 'keywords=[title]')" onfocus="context_menu_suppliers(this, 'keywords=[title]')" /></li>
        <li>负责人:&nbsp;
        	<select name="classid" id="classid">
        		<option value="">全部</option>
        		{classes}
        		<option value="{$classes.id}" {if $smarty.get.classid==$classes.id}selected{/if}>{$classes.title}</option>
        		{/classes}
        	</select>
        </li>
        <li>仓库:&nbsp;
        	<select name="shopid" id="shopid">
        		<option value="">全部</option>
        		{shops}
        		<option value="{$shops.id}" {if $smarty.get.shopid==$shops.id}selected{/if}>{$shops.title}</option>
        		{/shops}
        	</select>
        </li>
    </form>
    </div>

    <table width="100%" border="0" cellspacing="0" cellpadding="5" id="lister">
      <tr id="title">
        <td width="40">编号</td>
        <td>供应商名称</td>
        <td>负责人</td>
        <td>联系人</td>
        <td>联系电话</td>
        <td width="120">联系地址</td>
        <td>仓库</td>
        <td>是否通用</td>
        <td>&nbsp;</td>
      </tr>
      {suppliers limit=20 pager=pager page=$segment.page order="id desc" keywords=$smarty.get.keywords classid=$smarty.get.classid  shopid=$smarty.get.shopid}
      <tr id="content">
        <td>{$suppliers.id}</td>
        <td><a href="{$site_admin}m=inventory&s=suppliers.php&uri=view&id={$suppliers.id}">{$suppliers.title}</a></td>
        <td>{if $suppliers.classid==0}未指定{else}{classes id=$suppliers.classid}{$classes.title}{/classes}{/if}&nbsp;</td>
        <td>{$suppliers.linkman}&nbsp;</td>
        <td>{$suppliers.phone}&nbsp;</td>
        <td>{$suppliers.address}&nbsp;</td>
         <td>{$suppliers.shop_name}&nbsp;</td>
         <td>{if $suppliers.is_general}是{else}否{/if}&nbsp;</td>
        <td align="right">
        {if 0}{rights right='suppliers_delete'}<a href="{$site_admin}m=inventory&s=suppliers.php&uri=remove&id={$suppliers.id}" onclick="return confirm('删除数据不可恢复, 确定删除?')">删除</a>{/rights}{/if}
        {rights right='suppliers_modify'}<a href="{$site_admin}m=inventory&s=suppliers.php&uri=modify&id={$suppliers.id}">编辑</a>{/rights}
        <a href="{$site_admin}m=inventory&s=suppliers.php&uri=view&id={$suppliers.id}">查看</a>
        </td>
      </tr>
      {/suppliers}
      {if $pager->rows==0}
      <tr id="content">
        <td colspan="20">&nbsp;</td>
      </tr>
      {/if}
    </table>
    <div id="pager" class="mt10">
        {if $pager} 共{$pager->rows}条记录 第{$pager->pagecurrent}/{$pager->pages}页 {/if} 		
        {if $pager->current > 1}<a href="{url s1=1}">首页</a>{/if}
        {if $pager->current > 1}<a href="{url s1=$pager->current-1}">上页</a>{/if}
        {if $pager->current < $pager->pages}<a href="{url s1=$pager->current+1}">下页</a>{/if}
        {if $pager->current < $pager->pages}<a href="{url s1=$pager->pages}">尾页</a>{/if}
    </div>
    <p>&nbsp;</p>
    {rights right='suppliers_create'}<ul id="addmenu"><li><a href="{$site_admin}m=inventory&s=suppliers.php&uri=create">添加一个新的供应商</a></li></ul>{/rights}
</div>
{include file="admin/bottom.php"}
</body>
</html>
